﻿using System.Data.Linq.Mapping;
using System.Data;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
using System.ComponentModel;
using System;
using Oracle.DataAccess.Client;
using System.Data.Linq;

namespace ConsoleApplication1
{

  #region Line
  public class Line
  {
    public string TagNo;
    public string JobNo;
  }
  #endregion

  public class Program
  {
    static void Main(string[] args)
    {
      try
      {
        string connectionString = "user id=em; password=em; data source=localdb; persist security info=true";
        OracleConnection connection = new OracleConnection(connectionString);
        DataContext context = new DataContext(connection);

        var lines = context.ExecuteQuery<Line>("SELECT TAG TagNo, PROJ_NO JobNo FROM LINE Line");

        foreach (var line in lines)
        {
          Console.WriteLine(line.TagNo);
        }

        Console.ReadKey();
      }
      catch (Exception ex)
      {
        throw ex;
      }
    }
  }
}